package com.zcc.demo02;

public class Proxy {
    private UserServiceImpl userServiceImpl;
    public Proxy(){
    }

    public void setUserServiceImpl(UserServiceImpl userServiceImpl) {
        this.userServiceImpl = userServiceImpl;
    }

    public void add(){
        log("add");
        userServiceImpl.add();
    }

    public void delete(){
        log("delete");
        userServiceImpl.delete();
    }

    public void update(){
        log("update");
        userServiceImpl.update();
    }

    public void query(){
        log("query");
        userServiceImpl.query();
    }

    public void log(String msg){
        System.out.println("使用了"+msg+"方法");
    }
}
